package com.br.view;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JProgressBar;

import com.br.controller.ArquivoControl;
import com.br.controller.DocControl;
import com.br.controller.SetorControl;
import com.br.controller.StatusControl;
import com.br.controller.TpDocControl;
import com.br.controller.UserControl;

public class Splash extends JFrame{
	private JPanel contentPane;

	//Camada de controle:
	static public DocControl docControl;
	static public SetorControl setorControl;
	static public StatusControl statusControl;
	static public TpDocControl tpDocControl;
	static public UserControl userControl;
	static public ArquivoControl arquivoControl;

	//Telas:
	static public TelaInicial telaInicial;	
	static public EntradaDoc entradaDoc;	
	static public SaidaDoc saidaDoc;
	static public CadSetor cadSetor;
	static public CadTpDoc cadTpDoc;
	/**
	 * Launch the application.
	 */

	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Splash frame = new Splash();
					frame.setVisible(true);
					Login login = new Login();

					carregaClasses();

					frame.setVisible(false);
					login.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */

	public static void carregaClasses() {
		//Camada de controle:
		docControl = new DocControl();
		setorControl = new SetorControl();
		statusControl = new StatusControl();
		tpDocControl = new TpDocControl();
		userControl = new UserControl();
		arquivoControl = new ArquivoControl();

		//Telas:
		telaInicial = new TelaInicial();
		entradaDoc = new EntradaDoc();
		saidaDoc = new SaidaDoc();
		cadSetor = new CadSetor();
		cadTpDoc = new CadTpDoc();
	}

	public Splash() {	
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JLabel lblGerenciamentoDeDocumentos = new JLabel("Gerenciamento");
		lblGerenciamentoDeDocumentos.setFont(new Font("Verdana", Font.PLAIN, 30));
		lblGerenciamentoDeDocumentos.setBounds(77, 0, 236, 81);
		contentPane.add(lblGerenciamentoDeDocumentos);

		JLabel lblDeDocumentos = new JLabel("de Documentos");
		lblDeDocumentos.setFont(new Font("Verdana", Font.PLAIN, 30));
		lblDeDocumentos.setBounds(77, 63, 236, 81);
		contentPane.add(lblDeDocumentos);

		JLabel lblHnsg = new JLabel("HNSG");
		lblHnsg.setFont(new Font("Verdana", Font.PLAIN, 30));
		lblHnsg.setBounds(149, 118, 100, 87);
		contentPane.add(lblHnsg);

		JProgressBar progressBar = new JProgressBar();
		progressBar.setBounds(123, 216, 146, 14);
		contentPane.add(progressBar);
		progressBar.setStringPainted(true); 		

	}
}

